package com.lhl.biz.template.api.shared.define;

import lombok.Getter;
import lombok.Setter;

/**
 * @className: ConstantsTemplate
 * @description: 枚举常量类
 * @author: king
 * @date: 2020-06-17 10:12
 **/
public class ConstantsTemplate {
    public enum TemplateStatus {
        FIRST_TRIAL(1, "00000001", "第一"),
        SECODE_TRIAL(2, "00000002", "第二");

        TemplateStatus(long type, String code, String name) {
            this.type = type;
            this.code = code;
            this.name = name;
        }

        @Getter
        @Setter
        private long type;
        @Getter
        @Setter
        private String code;
        @Getter
        @Setter
        private String name;

        public static String getCode(String value) {
            TemplateStatus[] values = TemplateStatus.values();
            for (TemplateStatus templateStatus : values) {
                if (templateStatus.name.equals(value)) {
                    return templateStatus.getCode();
                }
            }
            return null;
        }
    }
}
